package components.validators
{
	import spark.validators.NumberValidator;
	
	import framework.LangMgr;
	
	import interfaces.IValidation;
	
	public class BaseNumberValidator extends NumberValidator
	{
		public function BaseNumberValidator()
		{
			super();
			decimalPointCountError = LangMgr.getResourceByLocaleKey("validate.decimalPointCountError");
			fractionalDigitsError = LangMgr.getResourceByLocaleKey("validate.fractionalDigitsError");
			greaterThanMaxError = LangMgr.getResourceByLocaleKey("validate.greaterThanMaxError");
			invalidCharError = LangMgr.getResourceByLocaleKey("validate.invalidCharError");
			invalidFormatCharsError = LangMgr.getResourceByLocaleKey("validate.invalidFormatCharsError");
			lessThanMinError = LangMgr.getResourceByLocaleKey("validate.lessThanMinError");
			localeUndefinedError = LangMgr.getResourceByLocaleKey("validate.localeUndefinedError");
			negativeError = LangMgr.getResourceByLocaleKey("validate.negativeError");
			negativeNumberFormatError = LangMgr.getResourceByLocaleKey("validate.negativeNumberFormatError");
			negativeSymbolError = LangMgr.getResourceByLocaleKey("validate.negativeSymbolError");
			notAnIntegerError = LangMgr.getResourceByLocaleKey("validate.notAnIntegerError");
			parseError = LangMgr.getResourceByLocaleKey("validate.parseError");
			requiredFieldError = LangMgr.getResourceByLocaleKey("validate.requiredFieldError");
		}
		
		override public function initialized(document:Object, id:String):void
		{
			super.initialized(document, id);
			var validation:IValidation = document as IValidation;
			if(validation)
				validation.pushValidator(this);
		}
	}
}